<template>
    <div class="login">
        <div class="login-wrap">

            <div class="username flex">
                <lable>账号：</lable>
                <input type="text" v-model="username">
            </div>
            <div class="password flex">
                <lable>密码：</lable>
                <input type="text" v-model="password">
            </div>
            <div class="btn" @click="goHomePage">登录</div>
            
        </div>
    </div>
</template>

<script setup>
import { ref } from "vue"
import { useRouter } from 'vue-router'
const username = ref('')
const password = ref('')
const router = useRouter()

const goHomePage = () =>{
    console.log(username.value, password.value);
    if(username.value == 'admin' && password.value == '123'){
        router.push('/home')
    }
}
</script>

<style lang="css" scoped>
.login{
    width: 100vw;
    height: 100vh;
    background-image: linear-gradient(to bottom, #fff,blanchedalmond);
    display: flex;
    justify-content: center;
    align-items: center;
}
.login-wrap{
    width: 350px;
}
.flex{
    height: 50px;
    display: flex;
    align-items: center
}
lable{
    width: 60px;
}
input{
    flex:1;
    font-size: 20px;
    padding: 5px;
}
.btn{
    width: 80%;
    font-size: 15px;
    padding: 10px 0;
    background-color: #fff;
    color:#000;
    text-align: center;
    margin: 0 auto;
    margin-top: 30px;
    border-radius: 100px;
    cursor: pointer;
}
</style>